#pragma once

#include <QtWidgets/QMainWindow>
#include "ui_LearningCenter.h"
#include <QDebug>

class QFrame;
class QTreeWidget;
class UiInterface;
class QTreeWidgetItem;
class LearningCenter : public QMainWindow
{
    Q_OBJECT

public:
    LearningCenter(QWidget *parent = nullptr);
    ~LearningCenter();

private:
    void loadPlugins();
    bool addPluginMenu(QString menu, UiInterface* pluginInterface);

private slots:
    void onPluginItemCicked(QTreeWidgetItem* item, int column);

protected:
    void resizeEvent(QResizeEvent* event) override;

private:
    Ui::LearningCenterClass ui;
    QTreeWidget* m_pluginTreeWidget;
    QFrame* m_pluginFrame;
    UiInterface* m_currentPluginInterface = nullptr;

    QMap<QString, UiInterface*> m_idAndUiInterfaceMap;
};